//代理配置
const { createProxyMiddleware } = require('http-proxy-middleware');

// proxy middleware options
module.exports = {
  s3001: createProxyMiddleware({
    target: 'http://localhost:3001', // target host
    changeOrigin: true, // needed for virtual hosted sites
    ws: true, // proxy websockets
    pathRewrite: {
      '^/api': '/', // rewrite path
    },
  }),
  s3002: createProxyMiddleware({
    target: 'http://localhost:3002', // target host
    changeOrigin: true, // needed for virtual hosted sites
    ws: true, // proxy websockets
    pathRewrite: {
      '^/resource': '/', // rewrite path
    },
  })
}